/*
 * @Descripttion:
 * @Author: Cenven
 * @version: @Lastest
 * @Date: 2020-12-07 11:07:37
 * @LastEditTime: 2021-01-10 16:10:36
 * @CopyRight: 北京泓深教育发展有限公司
 */

import http from "~/utils/http";
export const getDistributionInfo = data => {
  return http({
    url: "distribution/selectOneByUserId",
    method: "post",
    data
  });
};
export const getDistributionOrder = data => {
  return http({
    url: "distributionOrder/list",
    method: "post",
    data
  });
};
export const getWithdrawalLog = data => {
  return http({
    url: "withdrawalLog/list",
    method: "post",
    data
  });
};
export const toWithdrawal = data => {
  return http({
    url: "withdrawalLog/save",
    method: "post",
    data
  });
};
export const getQrcode = url => {
  return http({
    url: "client/url2qrcode",
    method: "post",
    data: {
      url
    }
  });
};
export const getQrcodeBlob = url => {
  return http({
    url: "client/url2qrcode",
    method: "post",
    responseType: "blob",
    data: {
      url
    }
  });
};
export const getMyTeam = data => {
  return http({
    url: "user/myTeam",
    method: "post",
    data
  });
};

//区域代理
export const getAreaAgentInfo = data => {
  return http({
    url: "agent/list",
    method: "post",
    data
  });
};
//区域代理下级利润流水
export const getAreaAgentLog = data => {
  return http({
    url: "web/agentAreaLog/list",
    method: "post",
    data
  });
};
export const getOwnProfit = data => {
  return http({
    url: "web/agentAreaProfit/list",
    method: "post",
    data
  });
};
//区域代理提现
export const areaAgentWithdrawal = data => {
  return http({
    url: "agent/withdrawal",
    method: "post",
    data
  });
};
export const saveCashAdvance = data => {
  return http({
    url: "web/agentAreaWithdrawal/save",
    method: "post",
    data
  });
};
export const getCashAdvance = data => {
  return http({
    url: "web/agentAreaWithdrawal/list",
    method: "post",
    data
  });
};

/**
 * 团队分销
 */
//提现
export const saveTeamProfit = data => {
  return http({
    url: "agent/team/withdrawal",
    method: "post",
    data
  });
};
//个人收益
export const getTeamProfit = data => {
  return http({
    url: "web/agentTeamProfit/mine/profit",
    method: "post",
    data
  });
};
//团队信息
export const getTeamInfo = data => {
  return http({
    url: "web/agentTeamInfo/list",
    method: "post",
    data
  });
};
//提现记录
export const getTeamWithdrawal = data => {
  return http({
    url: "web/agentTeamWithdrawalLog/list",
    method: "post",
    data
  });
};
//收益记录
export const getTeamLog = data => {
  return http({
    url: "web/agentTeamLog/list",
    method: "post",
    data
  });
};
//团队成员
export const getSupMemberMime = data => {
  return http({
    url: "web/agentTeamMember/list",
    method: "post",
    data
  });
};
